//
//  UITabBar+Chained.m
//  ObjectCChained
//
//  Created by sny on 2018/5/25.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "UITabBar+Chained.h"

@implementation UITabBar (Chained)

#pragma mark - getter

- (UITabBar *(^)(UIImage *,UIImage *,UIImage *))chainedImageSet {
    return ^UITabBar *(UIImage *backgroundImage,UIImage *selectionIndicatorImage,UIImage *shadowImage) {
        if (backgroundImage) {self.backgroundImage = backgroundImage;}
        if (selectionIndicatorImage) {self.selectionIndicatorImage = selectionIndicatorImage;}
        if (shadowImage) {self.shadowImage = shadowImage;}
        return self;
    };
}

- (UITabBar *(^)(UIColor *,UIColor *,UIColor *,UIColor *))chainedTintColorSet {
    return ^UITabBar *(UIColor *unselectedItemTintColor,UIColor *tintColor,UIColor *selectedImageTintColor,UIColor *barTintColor) {
        if (unselectedItemTintColor){self.unselectedItemTintColor = unselectedItemTintColor;}
        if (tintColor) {self.tintColor = tintColor;}
        if (selectedImageTintColor) {self.selectedImageTintColor = selectedImageTintColor;}
        if (barTintColor) {self.barTintColor = barTintColor;}
        return self;
    };
}

- (UITabBar *(^)(id))chainedTabBarDelegate {
    return ^UITabBar *(id delegateObject){
        if (delegateObject) {self.delegate = delegateObject;}
        return self;
    };
}

- (UITabBar *(^)(NSArray * ,CGFloat ,CGFloat ))chainedTabBarItemsSet {
    return ^UITabBar *(NSArray * items,CGFloat itemWidth,CGFloat itemSpacing) {
        if (items) {self.items = items;}
        if (itemWidth) {self.itemWidth = itemWidth;}
        if (itemSpacing) {self.itemSpacing = itemSpacing;}
        return self;
    };
}

- (UITabBar *(^)(BOOL))chainedTranslucent {
    return ^UITabBar *(BOOL translucent) {
        self.translucent = translucent;
        return self;
    };
}

- (UITabBar *(^)(UIBarStyle))chainedBarStyle {
    return ^UITabBar *(UIBarStyle barStyle) {
        self.barStyle = barStyle;
        return self;
    };
}

- (UITabBar *(^)(UITabBarItem *))chainedSelectedItem {
    return ^UITabBar *(UITabBarItem * selectedItem) {
        self.selectedItem = selectedItem;
        return self;
    };
}

- (UITabBar *(^)(UITabBarItemPositioning ))chainedItemPositioning {
    return ^UITabBar *(UITabBarItemPositioning itemPositioning) {
        self.itemPositioning = itemPositioning;
        return self;
    };
}

#pragma mark - setter

- (void)setChainedImageSet:(UITabBar *(^)(UIImage *, UIImage *, UIImage *))chainedImageSet {}

- (void)setChainedTintColorSet:(UITabBar *(^)(UIColor *, UIColor *,UIColor *))chainedTintColorSet {}

- (void)setChainedTabBarDelegate:(UITabBar *(^)(id))chainedTabBarDelegate {}

- (void)setChainedTabBarItemsSet:(UITabBar *(^)(NSArray *, CGFloat, CGFloat))chainedTabBarItemsSet {}

- (void)setChainedTranslucent:(UITabBar *(^)(BOOL))chainedTranslucent {}

- (void)setChainedBarStyle:(UITabBar *(^)(UIBarStyle))chainedBarStyle {}

- (void)setChainedSelectedItem:(UITabBar *(^)(UITabBarItem *))chainedSelectedItem {}

- (void)setChainedItemPositioning:(UITabBar *(^)(UITabBarItemPositioning))chainedItemPositioning {}

@end
